var express = require('express');
var router = express.Router();
var db = require('../public/javascripts/db');

router.post('/', (req, res, next) => {
    console.log(req.body)
    var sql = 'UPDATE results SET diagnostic_opinion = ? WHERE medical_num = ?';
    var sqlParams = [req.body.diagnostic_opinion, req.body.medical_num];
    db.query(sql, sqlParams, (err, result) => {
        if (err) {
            throw err;
            return;
        } else {
            res.send({status: 2})
        }
    })
})

module.exports = router;